import emun from "./index.js"
import dayjs from 'dayjs'
export function keyValue(keys, num) {
	if (!emun[keys]) {
		return
	}
	let temp = emun[keys].find((item, index) => {
		return item.value == num
	})
	return temp ? temp.text : ''
}
export function getZodiac(year) {
	const zodiacAnimals = ['鼠', '牛', '虎', '兔', '龙', '蛇', '马', '羊', '猴', '鸡', '狗', '猪'];
	return zodiacAnimals[(dayjs(year).year() - 1900) % 12];
}
export function getAge(value) {
	if (!value) {
		return
	}
	return dayjs().diff(value, 'year') + '岁'
}